package com.whfc.wxmp.api.fse.controller;

import com.whfc.common.result.Result;
import com.whfc.common.result.ResultUtil;
import com.whfc.wxmp.annotation.CurrentWxUser;
import com.whfc.fse.dto.FseDeviceInfoDTO;
import com.whfc.fuum.entity.WxUser;
import com.whfc.wxmp.api.fse.service.WxFseService;
import com.whfc.wxmp.util.RequestConetxtUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author qzexing
 * @version 1.0
 * @date 2021/11/4 16:32
 */
@RestController
@RequestMapping("/mp/api/fse")
public class WxFseController {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private WxFseService wxFseService;

    @GetMapping("/device/info")
    public Result getFseWarnMsgDetail(@CurrentWxUser WxUser loginUser,
                                      @RequestParam("deptId") Integer deptId) {
        logger.info("WXMPUA|{}|{}|{}|{}|{}",
                loginUser.getId(), RequestConetxtUtil.getAppType(), RequestConetxtUtil.getPage(),
                "查询特种设备-设备信息", RequestConetxtUtil.getParameters());
        FseDeviceInfoDTO deviceInfo = wxFseService.getFseDeviceInfo(deptId);
        return ResultUtil.success(deviceInfo);
    }

}
